import request from './request';
//可购买的产品列表
export function poOrderList(query) {
    return request({
        url: 'bdInvbasdoc/list',
        method: 'post',
        data: query,
    })
}

//获取最高价  最低价 和平均价
export function getPrice(query) {
    return request({
        url: 'bdInvbasdoc/count',
        method: 'post',
        data: query,
    })
}

//请购单新增
export function wlcSysAllAdd(query) {
    return request({
        url: 'wlcSysAll/add',
        method: 'post',
        data: query,
    })
}

//点击审批按钮
export function wlcSysAllAuditSubmit(query) {
    return request({
        url: 'wlcSysAll/auditSubmit',
        method: 'post',
        data: query,
    })
}
//最终确认单
export function wlcSysAllLastList(query) {
    return request({
        url: '/wlcSysAll/lastList',
        method: 'post',
        data: query,
    })
}

//请购单查询
export function wlcSysAllList(query) {
    return request({
        url: 'wlcSysAll/list',
        method: 'post',
        data: query,
    })
}
//请购单选择草稿
export function wlcSysAllListByDraft(query) {
    return request({
        url: 'wlcSysAll/listByDraft',
        method: 'post',
        data: query,
    })
}

//请购单详情查询
export function wlcSysAllListByOrder(query) {
    return request({
        url: 'wlcSysAll/listByOrder',
        method: 'post',
        data: query,
    })
}

//请购单删除
export function wlcSysAllRemove(query) {
    return request({
        url: 'wlcSysAll/remove',
        method: 'post',
        data: query,
    })
}
//请购单提交
export function wlcSysAllSubmit(query) {
    return request({
        url: 'wlcSysAll/submit',
        method: 'post',
        data: query,
    })
}
//请购单修改
export function wlcSysAllUpdate(query) {
    return request({
        url: 'wlcSysAll/update',
        method: 'post',
        data: query,
    })
}

//新增询价  保存
export function wlcSysInquirySave(query) {
    return request({
        url: 'wlcSysInquiry/save',
        method: 'post',
        data: query,
    })
}

//询价单详情
export function wlcSysInquiryDetail(query) {
    return request({
        url: 'wlcSysInquiry/detail',
        method: 'post',
        data: query,
    })
}

//新增询价  提交
export function wlcSysInquiryAdd(query) {
    return request({
        url: 'wlcSysInquiry/add',
        method: 'post',
        data: query,
    })
}
export function wlcSysInquirySubmit(query) {
    return request({
        url: 'wlcSysInquiry/submit',
        method: 'post',
        data: query,
    })
}

//询价列表
export function wlcSysInquiryList(query) {
    return request({
        url: 'wlcSysInquiry/list',
        method: 'post',
        data: query,
    })
}

//询价存为草稿
export function wlcSysInquiryUpdateAll(query) {
    return request({
        url: 'wlcSysInquiry/updateAll',
        method: 'post',
        data: query,
    })
}

export function wlcSysInquiryListInquiry(query) {
    return request({
        url: 'wlcSysInquiry/listInquiry',
        method: 'post',
        data: query,
    })
}
// 查询消息
export function wlcSysInquiryListNotice(query) {
    return request({
        url: 'wlcSysInquiry/listNotice',
        method: 'post',
        data: query,
    })
}
//删除列表数据
export function wlcSysInquiryRemove(query) {
    return request({
        url: 'wlcSysInquiry/remove',
        method: 'post',
        data: query,
    })
}
// 点击新增选择的列表
export function wlcSysInquirySeletelist(query) {
    return request({
        url: 'wlcSysInquiry/seleteList',
        method: 'post',
        data: query,
    })
}
// 修改列表数据
export function wlcSysInquiryUpdate(query) {
    return request({
        url: 'wlcSysInquiry/update',
        method: 'post',
        data: query,
    })
}
// 查询审批日志
export function wlcSysLogList(query) {
    return request({
        url: 'wlcSysLog/list',
        method: 'post',
        data: query,
    })
}

//单据设置
export function wlcSysAllDocumentSettings(query) {
    return request({
        url: 'wlcSysAll/documentSettings',
        method: 'post',
        data: query,
    })
}
//生产票据单号
export function wlcSysAllGetContractNo(query) {
    return request({
        url: 'wlcSysAll/getContractNo',
        method: 'post',
        data: query,
    })
}
//上传文件
export function bdInvbasdocUploadImage(query) {
    return request({
        url: 'bdInvbasdoc/uploadImage',
        method: 'post',
        data: query,
    })
}

//根据allId 获取请购单列表数据
export function wlcSysBackListByAllId(query) {
    return request({
        url: 'wlcSysBack/listByAllId',
        method: 'post',
        data: query,
    })
}

//根据allId 获取请购单列表数据
export function wlcSysInquiryWithBackIdSelectInquiry(query) {
    return request({
        url: 'wlcSysInquiry/withBackIdSelectInquiry',
        method: 'post',
        data: query,
    })
}


//汇总单 保存
export function wlcSysInquirySaveWlcSysInquiryLast(query) {
    return request({
        url: 'wlcSysInquiry/saveWlcSysInquiryLast',
        method: 'post',
        data: query,
    })
}

//最终确认单列表
export function wlcSysInquirySelectLast(query) {
    return request({
        url: 'wlcSysInquiry/selectLast',
        method: 'post',
        data: query,
    })
}

// 单据撤回，需要传all表ID，单据类型，部门id，进来
export function wlcSysAllWithdrawTicket(query) {
    return request({
        url: 'wlcSysAll/withdrawTicket',
        method: 'post',
        data: query,
    })
}
// 单据关闭，需要传all表ID，单据类型，部门id，进来
export function wlcSysAllCloseTicket(query) {
    return request({
        url: 'wlcSysAll/closeTicket',
        method: 'post',
        data: query,
    })
}

// 最终确认单审批,传入all表id
export function wlcSysInquiryCheckLast(query) {
    return request({
        url: 'wlcSysInquiry/checkLast',
        method: 'post',
        data: query,
        // headers: {
        //     'Content-Type': 'text/xml'
        // }
    })
}

// 最终确认单审批,传入all表id
export function wlcSysInquiryCheckLastFalse(query) {
    return request({
        url: 'wlcSysInquiry/checkLastFalse',
        method: 'post',
        data: query,
        // headers: {
        //     'Content-Type': 'text/xml'
        // }
    })
}

// 查询自己消息列表
export function wlcNoticeList(query) {
    return request({
        url: 'wlcNotice/list',
        method: 'post',
        data: query,
    })
}

//设置消息已读
export function wlcNoticeRsRead(query) {
    return request({
        url: 'wlcNotice/isRead',
        method: 'post',
        data: query,
    })
}

//导出请购单
export function wlcSysAllCheckOut(query) {
    return request({
        url: 'wlcSysAll/checkOut',
        method: 'post',
        data: query,
        responseType: 'blob',
    })
}

//询价单导出，前台需要传All表的ID进来和单据类型
export function wlcSysInquiryCheckOut(query) {
    return request({
        url: 'wlcSysInquiry/checkOut',
        method: 'post',
        data: query,
        responseType: 'blob',
    })
}

//最终确认单详情
export function wlcSysInquiryLastdetail(query) {
    return request({
        url: 'wlcSysInquiry/Lastdetail',
        method: 'post',
        data: query,
    })
}
// 最终确认单审批完成单据列表
export function wlcSysInquirySelectOkLast(query) {
    return request({
        url: 'wlcSysInquiry/selectOkLast',
        method: 'post',
        data: query,
    })
}
// 最终确认单审批完成单据详情
export function wlcSysInquiryOkLastdetail(query) {
    return request({
        url: 'wlcSysInquiry/OkLastdetail',
        method: 'post',
        data: query,
    })
}
//汇总询价单列表
export function wlcSysInquiryWlcSysInquiryLastList(query) {
    return request({
        url: 'wlcSysInquiry/wlcSysInquiryLastList',
        method: 'post',
        data: query,
    })
}

//汇总询价单列表
export function wlcSysInquiryUpdateAllOk(query) {
    return request({
        url: 'wlcSysInquiry/updateAllOk',
        method: 'post',
        data: query,
    })
}

//单个商品询价汇总数据
export function checkedWlcSysInquiryLastDetail(query) {
    return request({
        url: 'wlcSysInquiry/checkedWlcSysInquiryLastDetail',
        method: 'post',
        data: query,
    })
}

// 查询采购订单待审批消息
export function wlcPurchaseOrderLogListNotice(query) {
    return request({
        url: 'wlcPurchaseOrderLog/listNotice',
        method: 'post',
        data: query,
    })
}

///采购经理分配采购订单
export function WlcPurchaseAllowOrder(query) {
    return request({
        url: 'WlcPurchase/allowOrder',
        method: 'post',
        data: query,
    })
}

// 采购单详情/根据ID查询，不用其他字段
export function WlcPurchaseDetail(query) {
    return request({
        url: '/WlcPurchase/detail',
        method: 'post',
        data: query,
    })
}

// 查询采购单
export function WlcPurchaseList(query) {
    return request({
        url: '/WlcPurchase/list',
        method: 'post',
        data: query,
    })
}

// 采购员采购结束
export function WlcPurchaseSubmit(query) {
    return request({
        url: '/WlcPurchase/submit',
        method: 'post',
        data: query,
    })
}
//审批,id,nextAuditorId必传,每次审批需要指派下次审批人
export function wlcOrderAuditSubmit(query) {
    return request({
        url: '/wlcOrder/auditSubmit',
        method: 'post',
        data: query,
    })
}

// 订单详情/根据ID查询，不用其他字段
export function wlcOrderDetail(query) {
    return request({
        url: '/wlcOrder/detail',
        method: 'post',
        data: query,
    })
}
// 查询订单
export function wlcOrderList(query) {
    return request({
        url: '/wlcOrder/list',
        method: 'post',
        data: query,
    })
}


// 修改信息
export function wlcOrderEdit(query) {
    return request({
        url: '/wlcOrder/edit',
        method: 'post',
        data: query,
    })
}

//wlcSysInquiry/withdrawTicket询价汇总单据撤回，需要传all表ID,传值数组，支持批量撤回
export function wlcSysInquiryWithdrawTicket(query) {
    return request({
        url: '/wlcSysInquiry/withdrawTicket',
        method: 'post',
        data: query,
    })
}

// 询价单据撤回，需要传all表ID,传值数组，支持批量撤回
export function wlcSysBackWithdrawTicket(query) {
    return request({
        url: '/wlcSysBack/withdrawTicket',
        method: 'post',
        data: query,
    })
}











